<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>

    <title>跑腿小子-后台管理</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>

    <!-- Custom styles for this template -->
    <link th:href="@{/azthink/css/app.css}" rel="stylesheet"/>
</head>

<body>
<nav class="navbar navbar-expand-md navbar-dark bg-primary sticky-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">帮跑小子后台管理</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
                aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="navbar-nav mr-auto">



            </ul>

            <ul class="navbar-nav mt-2 mt-md-0">
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/manager/profile}" th:text="${session.manager.nickname}">李忠</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/publiz/logout}">注销</a>
                </li>

            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <nav class="col-md-2 d-none d-md-block bg-light sidebar">
            <div class="sidebar-sticky">
                <ul class="nav flex-column">
                    <li class="nav-item">
                        <a class="nav-link" th:href="@{/order/index}">
                            <span data-feather="bar-chart-2"></span>
                            订单管理 <span class="sr-only">(current)</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" th:href="@{/customer/index}">
                            <span data-feather="users"></span>
                            客户管理
                        </a>
                    </li>
                </ul>
            </div>
        </nav>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h1 class="h2">客户管理</h1>
            </div>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>登录账号</th>
                        <th>客户昵称</th>
                        <th>登录密码</th>
                        <th>是否配送员</th>
                        <th>申请状态</th>
                        <th>手机号码</th>
                        <th>注册时间</th>
                        <th>操作</th>

                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="customer : ${page.content}">
                        <td>#</td>
                        <td th:text="${customer.username}">#</td>
                        <td th:text="${customer.nickname}">#</td>
                        <td th:text="${customer.password}">#</td>
                        <td>
                            <span th:if="${customer.type == 1}">否</span>
                            <span th:if="${customer.type == 2}">是
                            </span>
                        </td>
                        <td>
                            <span th:if="${customer.applyStatus == 0}">未申请</span>
                            <span th:if="${customer.applyStatus == 1}">申请中
                            <a th:href="@{/customer/confirm(id=${customer.id},status=2)}">通过</a>
                            <a th:href="@{/customer/confirm(id=${customer.id}, status=9)}">不通过</a>
                            </span>
                            <span th:if="${customer.applyStatus == 2}">申请通过</span>
                            <span th:if="${customer.applyStatus == 9}">申请不通过</span>
                        </td>

                        <td th:text="${customer.mobile}">#</td>
                        <td th:text="${#dates.format(customer.registTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                        <td>
                            <a th:href="@{/customer/detail(id=${customer.id})}">详情</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

<script src="https://cdn.bootcss.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>

<!-- Icons -->
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script>
    var ctx = document.getElementById("myChart");
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            datasets: [{
                data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                lineTension: 0,
                backgroundColor: 'transparent',
                borderColor: '#007bff',
                borderWidth: 4,
                pointBackgroundColor: '#007bff'
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: false
                    }
                }]
            },
            legend: {
                display: false,
            }
        }
    });
</script>
</body>
</html>
